package com.asman.vr.network

import com.asman.vr.dto.*
import retrofit2.Call
import retrofit2.http.*

interface Api {

    //基础数据///////////////////////////////////////////////////////////////////////////////////
    //省市区
    @GET("web/district/list")
    fun getProvinceCityDistrict(): Call<BaseRes<List<DistrictsData>>>

    /**
     * 获取OSS上传的 bucket 和 endpoint
     * @param fileTypeCode 1：私有，4：公有的
     */
    @GET("web/oss/get_bucket")
    fun getOSSConfigData(@Query("fileTypeCode") fileTypeCode: Int?): Call<BaseRes<OSSConfigData>>

    /**
     * 云信IM登录需要用到的参数
     */
    @GET("/web/im/get_auth_info")
    fun getIMLoginParams(): Call<BaseRes<IMLoginParamsData>>

    /**
     * 获取风格列表
     */
    @GET("web/scheme/list_all_style")
    fun getStyleList(): Call<BaseRes<List<CaseStyleListData>>>

    ////账号相关/////////////////////////////////////////////////////////////////////////////////
    //微信用户授权登录接口
    @POST("api/user/app/wxLogin")
    fun wxLogin(@Body code: RequestBody.Code): Call<BaseRes<UserInfoData>>

    //获取手机验证码
    @POST("api/user/sendSmsCode")
    fun sendSmsCode(@Body phoneNumber: RequestBody.PhoneNumber): Call<BaseRes<Boolean>>

    //手机号登录
    @POST("api/user/app/loginByPhoneNumber")
    fun loginByPhoneNumber(@Body phoneAndCode: RequestBody.PhoneAndCode): Call<BaseRes<UserInfoData>>

    //三方平台登录绑定手机号---两个账号合并
    @POST("api/user/app/bindPhoneNumber")
    fun othersBindPhone(@Body bindPhone: RequestBody.BindPhone): Call<BaseRes<UserInfoData>>

    //手机号绑定三方平台--两个账号合并
    @POST("api/user/bindPhoneNumber")
    fun phoneBindOthers(@Body bindPhone: RequestBody.BindWX): Call<BaseRes<UserInfoData>>

    //授权后获取用户信息
    @GET("api/user/getUserInfo")
    fun getUserInfo(): Call<BaseRes<UserInfoData>>

    //修改绑定的手机号
    @POST("api/user/changePhoneNumber")
    fun changePhoneNumber(@Body phoneAndAndCode: RequestBody.PhoneAndCode): Call<BaseRes<Boolean>>

    //获取用户角色信息
    @GET("api/user/get_role_info")
    fun getUserRoleInfo(): Call<BaseRes<UserRoleInfoData>>

    //地址相关///////////////////////////////////////////////////////////////////////////////////
    //地址列表
    @GET("web/shipping/list_address")
    fun getAddressList(): Call<BaseRes<List<AddressListData>>>

    //支付相关//////////////////////////////////////////////////////////////////////////////////
    //创建支付凭证
    @POST("web/v3/payment/create_charge")
    fun createCharge(@Body createCharge: RequestBody.CreateCharge): Call<BaseRes<PayChargeData>>

    //查询支付信息
    @GET("web/v3/payment/get_for_payment")
    fun getPayInfo(@Query("paymentId") paymentId: Long): Call<BaseRes<PayInfoData>>

    //查询支付结果
    @GET("web/v2/payment/get_payment")
    fun getPayResult(@Query("paymentId") paymentId: Long): Call<BaseRes<PayResultData>>

    // 支付记录-阶段
    @GET("web/payment/order/list_order")
    fun getPayHistory(
            @Query("tradeId") tradeId: Long,
            @Query("paymentStage") paymentStage: Int
    ): Call<BaseRes<List<PayHistoryListData>>>

    // 支付记录-所有阶段
    @GET("web/progress/project_payment_bill")
    fun getAllPayHistory(@Query("projectId") projectId: Long): Call<BaseRes<PayAllDetailListData>>

    //提交银行转账凭证
    @POST("web/payment/order/add_order")
    fun submitPayBank(@Body body: RequestBody.UploadBackPay): Call<BaseRes<Boolean>>

    //我家相关///////////////////////////////////////////////////////////////////////////////////
    //项目列表
    @GET("web/progress/project_list")
    fun getProjectList(): Call<BaseRes<List<ProjectListData>>>

    //项目概要--施工概要
    @GET("web/progress/outline")
    fun getProjectInfo(@Query("projectId") projectId: Long): Call<BaseRes<ProjectInfoData>>

    //获取日志列表
//    @GET("web/journal/v2/project_journal_list")
    @GET("web/journal/v3/project_journal_list") //2019-10-31修改
    fun getRecodeList(
            @Query("projectId") projectId: Long?,
            @Query("sort") sort: Int?, /*排序规则 1:顺序   0:倒序*/
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int
    ): Call<BaseRes<ListResult<RecordListData>>>

    //确认开工
    @GET("web/progress/confirm_project")
    fun sureStartWork(@Query("projectId") projectId: Long): Call<BaseRes<Boolean>>

    //阶段验收通过
    @GET("web/progress/confirm_accept")
    fun stageApplyPass(
            @Query("projectId") projectId: Long,
            @Query("stageSerial") stageSerial: Int
    ): Call<BaseRes<Boolean>>

    //获取施工阶段列表
//    @GET("web/progress/payment_stage_list")
    @GET("web/progress/v2/stage_list") //2019-10-31
    fun getStageList(@Query("projectId") projectId: Long): Call<BaseRes<List<StageListData>>>

    //获取施工阶段任务列表
//    @GET("web/progress/payment_stage_task_list")
    @GET("web/progress/v2/stage_task_list")//2019-10-31
    fun getStageTaskList(
            @Query("projectId") projectId: Long,
            @Query("stageSerial") stageSerial: Int
    ): Call<BaseRes<StageTaskData>>

    //获取当前支付阶段的任务列表
    @GET("web/progress/v2/payment_stage_task_list")//2019-10-31 新增
    fun getPayTaskList(
            @Query("projectId") projectId: Long,
            @Query("paymentStageSerial") paymentStageSerial: Int
    ): Call<BaseRes<StageTaskData>>

    //获取摄像头信息
    @GET("web/camera/find_camera")
    fun getLiveInfo(@Query("projectId") projectId: Long): Call<BaseRes<LiveInfoData>>

    /**
     * 旋转摄像头
     * @param buttonStr cloud_deck_left,cloud_deck_right,cloud_deck_up,cloud_deck_down,cloud_deck_reset
     * @param projectId 项目ID
     */
    @GET("web/camera/turn_camera")
    fun liveTurnCamera(
            @Query("buttonStr") buttonStr: String,
            @Query("projectId") projectId: Long
    ): Call<BaseRes<Boolean>>

    //摄像头拍照
    @GET("web/camera/shoot")
    fun liveTakePhoto(@Query("projectId") projectId: Long): Call<BaseRes<String>>

    //消息相关////////////////////////////////////////////////////////////////////////////////////
    //获取消息列表
    @GET("web/msg/list")
    fun getMessageList(
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int
    ): Call<BaseRes<ListResult<MessageListData>>>

    //最新的一条系统消息
    @GET("web/msg/get_recent_message")
    fun getLastMessage(): Call<BaseRes<MessageListData>>

    //合同相关////////////////////////////////////////////////////////////////////////////////////
    //上传合同身份证+房产证信息
    @POST("web/contract/create_contract")
    fun uploadContractIDCardInfo(@Body body: RequestBody.UploadContractIDCard): Call<BaseRes<UploadCardInfoResultData>>

    //获取合同状态
    @GET("web/contract/contract_status")
    fun getContractStatus(@Query("projectId") projectId: Long): Call<BaseRes<ContractStatusData>>

    //获取合同信息
    @GET("web/contract/load_contract_data")
    fun getContractDetailInfo(@Query("projectId") projectId: Long): Call<BaseRes<ContractDetailInfoData>>

    //更新合同信息
    @PUT("web/contract/update_contract")
    fun updateContractInfo(@Body body: ContractDetailInfoData): Call<BaseRes<Long>>

    //获取合同url--签署完成之后等待上上签出合同url地址，异步生成，需要轮训
    @GET("web/contract/get_contract_url")
    fun getContractUrl(@Query("contractId") contractId: Long): Call<BaseRes<String>>

    //获取合同附件列表
    @GET("web/contract/get_attachment_list")
    fun getContractFiles(@Query("projectId") projectId: Long): Call<BaseRes<List<ContractFileListData>>>

    //运营相关////////////////////////////////////////////////////////////////////////////////////
    //获取app更新信息
    @GET("api/app/version/check")
    fun getAppUpdateInfo(): Call<BaseRes<AppUpdateData>>

    //方案相关scheme/////////////////////////////////////////////////////////////////////////////
    //查询楼盘列表
    @GET("web/v2/scheme/get_fuzzy_building")
    fun searchBuildingList(@Query("buildingName") buildingName: String?): Call<BaseRes<List<BuildingListData>>>

    //热门楼盘
    @GET("web/v2/scheme/get_hot_building")
    fun getHotBuilding(): Call<BaseRes<List<BuildingListData>>>

    /**
     * 搜索方案
     * @param buildingName 楼盘名 模糊搜索
     */
    @GET("web/v2/scheme/get_scheme_list")
    fun searchSchemeList(@Query("buildingName") buildingName: String?): Call<BaseRes<List<SchemeListData>>>

    /**
     * 获取方案列表--暂时不分页
     */
    @GET("web/v2/scheme/get_whole_scheme")
    fun getWholeSchemeList(): Call<BaseRes<List<SchemeListData>>>

    /**
     * 定制我家表单提交
     */
    @POST("web/v2/scheme/add_customized")
    fun submitMyCustom(@Body body: RequestBody.UploadMyHomeCustom?): Call<BaseResNull>

    /**
     * 搭我家表单提交
     */
    @POST("web/scheme/my_house/add")
    fun submitMyBuild(@Body body: RequestBody.BuildMyHomeRequestBody?): Call<BaseResNull>

    //网红设计师
    @GET("web/v2/scheme/get_red_design_list")
    fun getOnLineHotDesigner(): Call<BaseRes<List<DesignerListData>>>

    //获取方案概要
    @GET("web/v2/scheme/get_scheme_outline")
    fun getSchemeInfo(@Query("schemeId") schemeId: Long?): Call<BaseRes<SchemeInfoData>>

    @GET("web/scheme/search_scheme_by_id")
    fun getSchemeInfoDetail(
            @Query("id") schemeId: Long?,
            @Query("vrType") vrType: Int?
    ): Call<BaseRes<SchemeInfoDetailData>>

    //基础装修 报价数据
    @GET("web/v2/scheme/query_basic_quotation")
    fun getDecorateBaseInfo(@Query("schemeId") schemeId: Long?): Call<BaseRes<BaseDecorateListData>>

    /**
     * 基础装修 报价数据
     * @param schemeId 方案ID
     * @param partType 1软装  2 硬装
     */
    @GET("web/v2/scheme/query_soft_hard_quotation")
    fun getHardSoftPriceInfo(
            @Query("schemeId") schemeId: Long?,
            @Query("partType") partType: Int
    ): Call<BaseRes<List<RoomListData>>>

    @POST("web/sketch_scheme/filter")
    fun getHomeDataList(@Body homeDataFilter: RequestBody.HomeDataFilterRequest): Call<BaseRes<ListResult<HomeCardListData>>>

    //获取报价单信息---包含了所有的信息，根据入参区别
    @POST("web/v3/trade/part_query_quotation")
    fun getGoodsDecorateData(@Body requestBody: RequestBody.DecorateRequest): Call<BaseRes<GoodsDecorateData>>

    //获取报价单信息---包含了所有的信息，根据入参区别
    @POST("web/v3/trade/brief_confirm_trade")
    fun updateDecorateGoods(@Body requestBody: RequestBody.DecorateUpdateGoodsRequest): Call<BaseRes<GoodsDecorateDataUpdate>>

    //方案筛选条件--热门楼盘列表获取
    @GET("web/building/get_hot_building")
    fun getHomeDataFilterHotBuindings(): Call<BaseRes<List<FilterData>>>

    //方案筛选条件--风格列表获取
    @GET("web/scheme/list_all_style")
    fun getHomeDataFilterStyleLists(): Call<BaseRes<List<FilterData>>>

    //评论 评价 相关/////////////////////////////////////////////////////////////////////////////
    /**
     * 获取当前日志的所有评论列表
     * @param journalId 日志id
     * @param projectId 项目id
     */
    @GET("web/project/review/detail")
    fun getAllCommentList(
            @Query("journalId") journalId: Long?,
            @Query("projectId") projectId: Long?
    ): Call<BaseRes<List<CommentData>>>

    //添加评论，添加回复
    @POST("web/project/review/review")
    fun addComment(@Body addComment: RequestBody.AddComment): Call<BaseRes<Long>>

    /**
     * 根据评分等级获取评论常用语
     * @param roleType：角色类型 用户-0,牛牛搭传 0
     * @param level 评分等级 0，1，2，3，4
     */
    //评论常用语 列表
    @GET("web/project/review/quick")
    fun getCommentTags(
            @Query("roleType") roleType: Int?,
            @Query("level") level: Int?
    ): Call<BaseRes<List<String>>>

    //查询标签列表
    @POST("web/project/review/search")
    fun getTagList(@Body scoreTagSearches: List<RequestBody.QueryTags>): Call<BaseRes<List<ScoreTagData>>>

    //添加评分
    @POST("web/project/review/score")
    fun addScore(@Body addScore: RequestBody.AddScore): Call<BaseResNull>

    //我的收藏相关 /////////////////////////////////////////////////////////
    //方案添加收藏--ADC方案和3DMax方案
    @POST("web/scheme/collection/add")
    fun addSchemeCollect(@Body collectionRequestBody: CollectionRequestBody.SchemeCollectBody): Call<BaseRes<Int>>

    //取消方案收藏--ADC方案和3DMax方案
    @PUT("web/scheme/collection/cancel")
    fun deleteSchemeCollect(@Body collectionRequestBody: CollectionRequestBody.SchemeCollectBody): Call<BaseRes<Int>>

    //取消收藏我的换搭
    @PUT("web/scheme/works/update_status")
    fun deleteWorkCollect(@Body workCollectBody: CollectionRequestBody.WorkCollectBody): Call<BaseRes<Boolean>>

    //取消设计师关注
    @PUT("web/designer/cancel_collect_designer")
    fun deleteDesignerCollect(@Body workCollectBody: CollectionRequestBody.DesignerCollectBody): Call<BaseResNull>

    //添加设计师关注
    @PUT("web/designer/collect_designer")
    fun addDesignerCollect(@Body workCollectBody: CollectionRequestBody.DesignerCollectBody): Call<BaseResNull>

    //获取收藏的各个类型的个数
    @GET("web/scheme/works/get_works_num")
    fun getCollectionCountInfo(): Call<BaseRes<CollectionCountData>>


    /**
     * 获取我收藏的案例和我的换搭列表
     * @param type 1：我的换搭，2：收藏的案例
     */
    @GET("web/scheme/works/list")
    fun getCollectionSchemeList(
            @Query("type") type: Int,
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int
    )
            : Call<BaseRes<ListResult<CollectionSchemeListData>>>

    /**
     * 收藏的店铺列表
     * @param type:2  这里固定2--和小程序一直，具体类型不清楚
     */
    @GET("web/designer/collection_designers")
    fun getCollectionDesignerShopList(@Query("type") type: Int): Call<BaseRes<List<CollectionDesignerShopListData>>>

    /**
     * 收藏的商品列表
     */
    @GET("web/goods/collection/list")
    fun getCollectionGoodsList(
            @Query("pageNo") pageNo: Int, @Query("pageSize") pageSize: Int
    ): Call<BaseRes<ListResult<CollectionGoodsListData>>>

    /**
     * 获取该商品是否已经收藏过
     */
    @GET("web/goods/collection/get_status")
    fun getGoodsCollectStatus(@Query("skuId") skuId: Long): Call<BaseRes<GoodsCollectStatus>>

    /**
     * 商品添加收藏
     */
    @POST("web/goods/collection/add")
    fun addGoodsCollect(@Body collectionRequestBody: CollectionRequestBody.GoodsCollectBody): Call<BaseRes<Int>>

    /**
     * 商品移除收藏
     */
    @PUT("web/goods/collection/del")
    fun deleteGoodsCollect(@Body collectionRequestBody: CollectionRequestBody.GoodsCollectBody): Call<BaseResNull>

    //设计师店铺相关 /////////////////////////////////////////////////////////
    //设计师概要信息
    @GET("web/designer/home_page/designer_info")
    fun getDesignerInfo(@Query("userId") designerId: Long): Call<BaseRes<DesignerInfoData>>

    //在售商品列表
    @GET("web/designer/home_page/get_goods_list")
    fun getDesignerSaleGoodList(
            @Query("userId") designerId: Long,
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int
    ): Call<BaseRes<ListResult<DesignerSalesGoodsListData>>>

    //作品案例列表
    @GET("web/designer/home_page/get_case_list")
    fun getDesignerCaseList(
            @Query("userId") designerId: Long,
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int
    ): Call<BaseRes<ListResult<DesignerCaseListData>>>

    //作品案例详情
    @GET("web/designer/home_page/get_case_detail")
    fun getDesignerCaseDetail(
            @Query("userId") designerId: Long, @Query("id") caseId: Long
    ): Call<BaseRes<DesignerCaseDetailData>>

    //商品相关 /////////////////////////////////////////////////////////
    //商品详情
    @GET("web/goods/detail")
    fun getGoodsDetail(
            @Query("skuId") skuId: Long,
            @Query("tenantId") tenantId: Long//租户id
    ): Call<BaseRes<GoodsDetailData>>

    //实时语音 /////////////////////////////////////////////////////////
    //拒绝接听
    @POST("web/rtc/reject")
    fun rejectAnswer(@Body reject: RejectAnswerBody): Call<BaseResNull>

    ///接听之后挂断电话
    @POST("web/rtc/hang_up")
    fun hangUp(@Body hangUp: HangUpBody): Call<BaseRes<Boolean>>

    //设计师接听 告诉后端设计师当前处于通话中
    @POST("web/rtc/answer")
    fun hasReceived(@Body hangUp: HangUpBody): Call<BaseRes<Boolean>>

    //设计师接听的时候，校验是否用户已挂断，或者电话被转接，或者超时
    @GET("web/rtc/get_call_status2")
    fun canReceived(@Query("roomId") roomId: Int): Call<BaseRes<Boolean>>

    //获取初始化腾讯语音参数
    @GET("web/rtc/get_rtc_auth_info")
    fun getTrtcAuthInfo(
            @Query("schemeId") schemeId: Long?,
            @Query("vrType") vrType: Int?
    ): Call<BaseRes<TrtcAuthInfoData>>

    //记录实时语音流程的日志接口
    @POST("web/rtc/log")
    fun submitTrtcLog(@Body body: TrtcLogBody): Call<BaseRes<Boolean>>

    //客户中心 接口名待定
    @GET("web/rtc/customer/get_list")
    fun getCustomerList(
            @Query("pageNo") pageNo: Int,
            @Query("pageSize") pageSize: Int,
            @Query("status") status: Int// 0/null：全部，1：已接听，2：未接听
    ): Call<BaseRes<ListResult<CustomerListData>>>
}

